package com.demo_springboot.controller;

import com.demo_springboot.domain.Bean;
import com.demo_springboot.mapper.BeanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
@Repository
public class MybatisController {
    @Autowired
    private BeanMapper beanMapper;
    @RequestMapping("/query")
    @ResponseBody

    public List<Bean> queryBean() {
        List<Bean> beans = beanMapper.queryBeanList();
        return beans;
    }
}
